<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title></title>
		<style type="text/css">
			canvas{border: 1px solid #333;}
		</style>
	</head>
	<body>
		<canvas width="600" height="400"></canvas>
	</body>
	<script type="text/javascript">
		let canvas=document.querySelector("canvas");
		let ctx=canvas.getContext("2d");
		
		let img=new Image()
		img.src="./static/葫芦娃.png";
		
		//图片加载完之后，再绘制图片
		img.onload=()=>{
			ctx.drawImage(img,100,100,100,100)
		}
		

	</script>
</html>